﻿@{
    Layout = null;
}

<form id="fm">
    <table class="table">
        <tbody>
            <tr>
                <td class="center">
                    <h1 style="color:darkblue;">
                        <span class="fa fa-user"></span>
                    </h1>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="fa fa-user"></span>
                        </span>
                        <input type="text" class="form-control" name="username" placeholder="user name" />
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="fa fa-lock"></span>
                        </span>
                        <input type="password" class="form-control" name="password" placeholder="password" />
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <button type="submit" class="btn btn-primary btn-block">登录</button>
                </td>
            </tr>
        </tbody>
    </table>
</form>
<script type="text/javascript">
    $(function () {
        $('#fm').submit(function () {
            var form = $(this);
            var data = form.serializeArray();
            postJson('/Account/LoginByPassword', data, function (res) {
                if (res.success) {
                    window.location.reload();
                }
                else {
                    alert(res.msg);
                }
            });
            return false;
        });
    });
</script>